/* ==========================================================================
   HERO SPLIT LAYOUT — Top: Branding | Bottom: Slider
   ========================================================================== */

.hero-split-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    /* Fill the full viewport height */
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    overflow: hidden;
}

/* ---- TOP HALF: KOMISI QURAN Branding ---- */
.hero-top-brand {
    flex: 0 0 33.333%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Rich multi-tone gradient: deep espresso → warm walnut → dark sienna → back */
    background:
        radial-gradient(ellipse at 20% 80%, rgba(140, 80, 20, 0.35) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 40%),
        linear-gradient(155deg,
            #0d0803 0%,
            #1a0f05 20%,
            #2C1E11 45%,
            #4a2e14 65%,
            #2C1E11 80%,
            #0d0803 100%
        );
}

/* Radial glow decoration in center */
.hero-top-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 70% at 50% 50%, rgba(212,175,55,0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* Decorative corner geometric lines */
.hero-top-brand::before,
.hero-top-brand::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 4px;
    pointer-events: none;
}

.hero-top-brand::before {
    inset: 18px 24px;
}

.hero-top-brand::after {
    inset: 28px 38px;
    border-color: rgba(212, 175, 55, 0.08);
}

/* Brand content block */
.hero-brand-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 32px;
    animation: brandReveal 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes brandReveal {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-brand-eyebrow {
    font-family: var(--font-arabic);
    font-size: clamp(1rem, 2vw, 1.35rem);
    color: rgba(212, 175, 55, 0.80);
    letter-spacing: 1px;
    line-height: 1.6;
    text-shadow: 0 0 20px rgba(212,175,55,0.3);
}

.hero-brand-name {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 7vw, 5.6rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.0;
    letter-spacing: 0.08em;
    text-shadow:
        0 2px 10px rgba(0,0,0,0.6),
        0 0 40px rgba(212,175,55,0.18);
}

.hero-brand-rule {
    width: 80px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--secondary), transparent);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

.hero-brand-school {
    font-family: var(--font-body);
    font-size: clamp(0.75rem, 1.6vw, 1.05rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.68);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ---- BOTTOM HALF: Image Slider ---- */
.hero-bottom-slider {
    flex: 0 0 66.667%;
    position: relative;
    overflow: hidden;
    background: #111;
}

/* Slides live inside .hero-bottom-slider */
.hero-bottom-slider .hslider-track {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hslide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    will-change: opacity;
}

.hslide.active {
    opacity: 1;
}

/* Dot Indicators – bottom center of the slider */
.hslider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 5;
}

.hslider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: all 0.35s ease;
    backdrop-filter: blur(2px);
}

.hslider-dot.active {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.92);
    transform: scale(1.32);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.hslider-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(255, 255, 255, 0.75);
}

/* Base Navbar Styles */
.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}
.mobile-menu-btn {
    display: none;
}

/* Mobile Responsive Enhancements */
@media (max-width: 992px) {
    /* Navbar styling */
    .mobile-menu-btn {
        display: block !important;
        background: transparent;
        border: none;
        color: #ffffff !important; /* White color so it is visible on the dark hero background */
        font-size: 1.6rem;
        cursor: pointer;
        z-index: 2000;
        margin-left: auto;
        transition: color 0.3s;
    }
    .mobile-menu-btn:hover {
        color: var(--secondary) !important;
    }
    
    .public-navbar {
        padding: 15px 5vw !important;
    }

    .nav-links {
        display: flex !important; /* Override display: none to allow smooth transitions */
        position: absolute;
        top: 70px;
        left: 5vw;
        right: 5vw;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 20px;
        border-radius: 12px;
        gap: 15px;
        box-shadow: 0 15px 35px rgba(0,0,0,0.15);
        border: 1px solid rgba(212,175,55,0.2);
        z-index: 1500;
        
        /* Dropdown animation styles */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
    }
    
    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .pub-nav-link {
        color: var(--text-main) !important;
        width: 100%;
        padding: 8px 10px;
        border-radius: 8px;
        transition: background 0.2s, color 0.2s;
    }
    .pub-nav-link:hover {
        background: rgba(140, 98, 57, 0.08);
        color: var(--primary) !important;
    }

    .pub-nav-dropdown-menu {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        padding: 5px 15px !important;
        transform: none !important;
        min-width: 100% !important;
        display: none;
    }
    .pub-nav-dropdown:hover .pub-nav-dropdown-menu,
    .pub-nav-dropdown:active .pub-nav-dropdown-menu {
        display: block !important;
    }
    .pub-nav-dropdown-menu a {
        padding: 8px 10px !important;
        color: var(--text-muted) !important;
        background: transparent !important;
    }
    .pub-nav-dropdown-menu a:hover {
        color: var(--primary) !important;
        padding-left: 20px !important;
    }

    /* Hero Section */
    .hero-split-section {
        min-height: 500px;
    }

    .hero-brand-name {
        font-size: 2rem !important;
        letter-spacing: 0.05em;
    }

    .hero-brand-school {
        font-size: 0.65rem !important;
        letter-spacing: 0.08em;
        line-height: 1.4;
    }
    
    .hero-top-brand {
        padding: 20px !important;
    }

    /* Program Kami section */
    .pk-container {
        gap: 30px !important;
    }
    .pk-card {
        flex-direction: column !important;
    }
    .pk-content {
        padding: 25px !important;
    }
    
    /* Modals & Forms */
    .glass-card {
        padding: 25px 20px !important;
        max-width: 95% !important;
        margin: 0 auto;
    }
    
    #modal-daftar-lajnah > div {
        max-width: 95% !important;
        padding: 20px !important;
        margin: 0 auto;
    }
}


/* Mobile home navigation and touch-friendly public layout */
.mobile-home-tabbar { display: none; }

@media (max-width: 768px) {
    .public-navbar { display: none !important; }

    .mobile-home-tabbar {
        position: fixed;
        z-index: 1200;
        inset: auto 0 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: stretch;
        min-height: 62px;
        padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
        background: rgba(255, 253, 249, 0.97);
        border-top: 1px solid rgba(140, 98, 57, 0.18);
        box-shadow: 0 -6px 22px rgba(44, 30, 17, 0.12);
        backdrop-filter: blur(14px);
    }

    .mobile-home-tabbar button {
        display: flex;
        min-width: 0;
        min-height: 50px;
        padding: 5px 2px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: #725033;
        font: inherit;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-home-tabbar button i { font-size: 1.08rem; line-height: 1; }
    .mobile-home-tabbar button span {
        overflow: hidden;
        max-width: 100%;
        font-size: clamp(0.52rem, 2.1vw, 0.66rem);
        font-weight: 700;
        line-height: 1.1;
        letter-spacing: 0.015em;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-home-tabbar button[aria-current="page"] {
        background: #8c6239;
        color: #fff;
    }
    .mobile-home-tabbar button:focus-visible {
        outline: 3px solid #d4af37;
        outline-offset: -2px;
    }

    .public-content { padding-bottom: calc(76px + env(safe-area-inset-bottom)); overflow-x: clip; }
    .hero-split-section { min-height: min(720px, 84svh); height: min(720px, 84svh); }
    .hero-top-brand { flex-basis: 34%; min-height: 190px; }
    .hero-bottom-slider { flex-basis: 66%; }
    .hero-brand-content { gap: 9px; padding: 18px 16px; }
    .hero-brand-name { font-size: clamp(2rem, 10vw, 3.2rem) !important; }
    .hero-brand-school { max-width: 28rem; font-size: clamp(0.58rem, 2.6vw, 0.78rem) !important; }
    .hero-top-brand::before { inset: 12px; }
    .hero-top-brand::after { inset: 19px; }

    #info-eduplan { padding: 64px 18px !important; scroll-margin-top: 12px; }
    #info-eduplan h2 { font-size: clamp(1.7rem, 7vw, 2.4rem) !important; }
    #info-eduplan .eduplan-grid,
    #info-eduplan [class*="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    #program-kami, #info-eduplan { scroll-margin-bottom: 80px; }

    .public-layout, .public-content, .view-pane { max-width: 100%; }
    .public-content img, .public-content video, .public-content iframe { max-width: 100%; }
}

@media (max-width: 380px) {
    .mobile-home-tabbar { padding-left: 2px; padding-right: 2px; }
    .mobile-home-tabbar button span { font-size: 0.5rem; }
}

/* Compact mobile grids for the Home statistics and Eduplan classes */
@media (max-width: 768px) {
    .home-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
    .home-stats-grid .stat-card { padding: 20px 10px; }
    .home-stats-grid .stat-icon-wrapper {
        width: 42px;
        height: 42px;
        margin-bottom: 10px;
        font-size: 1.55rem;
    }
    .home-stats-grid .stat-number { font-size: 2.25rem; }
    .home-stats-grid .stat-label { font-size: 0.76rem; line-height: 1.35; }

    #info-eduplan .eduplan-class-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    #info-eduplan .eduplan-class-card {
        min-width: 0;
        padding: 14px 8px !important;
        gap: 10px !important;
        align-items: stretch;
    }
    #info-eduplan .eduplan-class-card > div:first-child {
        flex-direction: column;
        align-items: center !important;
        justify-content: center;
        gap: 7px !important;
        margin-bottom: 0 !important;
        text-align: center;
    }
    #info-eduplan .eduplan-class-card > div:first-child > div {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
    }
    #info-eduplan .eduplan-class-card > div:first-child > div i { font-size: 1rem !important; }
    #info-eduplan .eduplan-class-card h3 { font-size: 0.9rem !important; }
    #info-eduplan .eduplan-view-button {
        padding: 9px 4px !important;
        font-size: 0.78rem !important;
        white-space: nowrap;
    }
    #info-eduplan .eduplan-view-button i { margin-right: 3px !important; }
}
